package touchtrack.view.gesture;

import org.mt4j.MTApplication;
import org.mt4j.input.inputProcessors.IGestureEventListener;
import org.mt4j.input.inputProcessors.MTGestureEvent;
import org.mt4j.input.inputProcessors.componentProcessors.zoomProcessor.ZoomEvent;

import touchtrack.view.scene.TrackGraphScene;

/**
 * TrackDetailGestureListener
 * 
 * @author	MuMe09 team 6
 * 			http://mumetech.wordpress.com/
 */
public class TrackDetailGestureListener implements IGestureEventListener 
{
	private MTApplication app;
	private TrackGraphScene graphScene;
	
	/**
	 * Constructor.
	 * 
	 * @param 	MTApplication app
	 * @param 	TrackGraphScene graphScene
	 */
	public TrackDetailGestureListener(MTApplication app, TrackGraphScene graphScene)
	{
		this.app = app;
		this.graphScene = graphScene;
	}

	@Override
	public boolean processGestureEvent(MTGestureEvent ge)
	{
		// TAP
		if(ge instanceof ZoomEvent)
		{
			ZoomEvent ze = (ZoomEvent) ge;
			//IMTComponent3D target = ze.getTargetComponent();
			
			switch (ze.getId())
			{
			case ZoomEvent.GESTURE_DETECTED:
				app.changeScene(graphScene);
				break;
			case ZoomEvent.GESTURE_UPDATED:
				break;
			case ZoomEvent.GESTURE_ENDED:
				break;
			default:
				break;
			}
		}
		
		return false;
	}
}